<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Insert title here</title>
</head>
<body>
<div class="modal-dialog" role="document" style="width:700px;">
    <div class="modal-content">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            <h4 class="modal-title" id="exampleModalLabel">修改密码</h4>
        </div>
        <form class="form-horizontal" style="padding-right: 17px;" id="pwdForm">
            <input type="hidden" value="1" name="submitForm" />
            <div class="panel-body">
                <div class="form-group">
                    <label class="control-label col-sm-3">密码:</label>
                    <div class="col-sm-7">
                        <input type="password" class="form-control" name="pwd" value="" placeholder="请输入您的新密码">
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-sm-3">确认密码:</label>
                    <div class="col-sm-7">
                        <input type="password" class="form-control" name="pwd1" value="" placeholder="请再次输入您的新密码">
                    </div>
                </div>
            </div>
        </form>
        <div class="modal-footer">
            <button type="button" data-dismiss="modal" class="btn btn-default">取消</button>
            <button type="button" id="save" class="btn btn-primary">保存</button>
        </div>
    </div>
</div>

<script type="text/javascript">

    $(function(){
        $("#save").bind("click",doSave);
    });

    function doSave(){
        $.ajax({
            url: "{:U('Admin/User/modifyPwd')}",
            type: "post",
            dataType: "json",
            data: $("#pwdForm").serialize(),
            success: function (data) {
                if(data.status){
                    common.alert("提示",data.msg,function(){
                        common.reload();
                    });
                }else{
                    common.alert("提示",data.msg);
                }
            }
        });
    }
</script>
</body>
</html>